Nuquerna Dae wrote:
I'm kinda totally new with VB.net and the api stuff, but getting along with the basics to experiment a bit.
Your explanation and example were very helpfull so far, but i'm lacking the knowledge at this point to get the EveJournal list into a DataGridView, any tips? I get it to work when i open and read an exported .csv file, but can't figure out how to get the info from the EveJournal List that is created into a DataViewGrid. Thanks in advance.
Nuq.
Nuq,
The best thing that I can suggest is to create data table object and set it up with a column for each piece of information you want to capture. Then create a for loop to process through the journal entries. Once you have completed that process you can set the data grid's data source equal to the data table and then bind the data sources. For the sake of this example I will assume you are doing this on the individual level and not the corporate level, I have also assumed that you have created an API object and passed it the parameters required to get it to work.
Once you have that taken care of you need to setup a container to collect your data into, in this case if you are going straight to a data grid you can simply build a data table like so:
Dim eveOutput As New DataTable
eveOutput.Columns.Add("accountKey")
eveOutput.Columns.Add("Date")
eveOutput.Columns.Add("TransferType")
eveOutput.Columns.Add("GivingPartyName")
eveOutput.Columns.Add("ReceivingPartyName")
eveOutput.Columns.Add("AdditionalDataName")
eveOutput.Columns.Add("Amount")
eveOutput.Columns.Add("Balance")
eveOutput.Columns.Add("Reason")
eveOutput.Columns.Add("TaxAmount")
eveOutput.Columns("accountKey").DataType = System.Type.GetType("System.Int32")
eveOutput.Columns("Date").DataType = System.Type.GetType("System.DateTime")
eveOutput.Columns("TransferType").DataType = System.Type.GetType("System.String")
eveOutput.Columns("GivingPartyName").DataType = System.Type.GetType("System.String")
eveOutput.Columns("ReceivingPartyName").DataType = System.Type.GetType("System.String")
eveOutput.Columns("AdditionalDataName").DataType = System.Type.GetType("System.String")
eveOutput.Columns("Amount").DataType = System.Type.GetType("System.Decimal")
eveOutput.Columns("Balance").DataType = System.Type.GetType("System.Decimal")
eveOutput.Columns("Reason").DataType = System.Type.GetType("System.String")
eveOutput.Columns("TaxAmount").DataType = System.Type.GetType("System.Decimal")
Once you have done this you can simply execute the call to the API to collect the journal entries, and then process through them like so:
Dim eveJournal As List(Of EveAI.Live.JournalEntry) = eveAPI_Wallets.GetCorporationWalletJournal()
For Each eveEntry As EveAI.Live.JournalEntry In eveJournal
Dim tmpRow As DataRow = eveOutput.NewRow
tmpRow("accountKey") = BLAHH
.
.
.
.
.
eveOutput.Rows.Add(tmpRow)
Next
Then once this is done you can finally say this.
dvDataView.DataSource = eveOutput
dvDataView.DataBind()
Hope this gets you started! Please ping me in game if you have any questions!